From c622ce9b5d45bab69527dd5687600275af694a5d Mon Sep 17 00:00:00 2001 From: robertl Date: Sun, 23 Jan 2005 04:19:50 +0000 Subject: [PATCH] util.c: add case_ignore_strncmp git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@1043 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/util.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gpsbabel/util.c b/gpsbabel/util.c index 69f0d9370..165453a3e 100644 --- a/gpsbabel/util.c +++ b/gpsbabel/util.c @@ -326,6 +326,20 @@ case_ignore_strcmp(const char *s1, const char *s2) } +int +case_ignore_strncmp(const char *s1, const char *s2, int n) +{ + int rv = 0; + + while (n && ((rv = toupper(*s1) - toupper(*s2)) == 0) + && *s1) { + s1++; + s2++; + n--; + } + return rv; +} + void printposn(const double c, int is_lat) { -- 2.30.2